// JavaScript Document
$('#dep_arp').click(function(){page="airport_code.php";$("#dep_t").html('<select id="dep" name="dep" class="required"></select>');$("#dep").fcbkcomplete({ json_url: page,cache: false,filter_case: false,filter_hide: false,firstselected: false});});
$('#dep_sta').click(function(){page="state.php";$("#dep_t").html('<select id="dep" name="dep" class="required"></select>');$("#dep").fcbkcomplete({ json_url: page,cache: false,filter_case: false,filter_hide: false,firstselected: false});});
$('#dep_con').click(function(){page="country.php";$("#dep_t").html('<select id="dep" name="dep" class="required"></select>');$("#dep").fcbkcomplete({ json_url: page,cache: false,filter_case: false,filter_hide: false,firstselected: false});});
$('#dep_reg').click(function(){page="region.php";$("#dep_t").html('<select id="dep" name="dep" class="required"></select>');$("#dep").fcbkcomplete({ json_url: page,cache: false,filter_case: false,filter_hide: false,firstselected: false});});

$('#dep_all').click(function(){
							$("#dep_t").html('<input type="text" name="dep[]" id="dep" value="ALL" readonly="readonly" width="300" height="15" />');							
							});


$('#ret_arp').click(function(){page="airport_code.php";$("#ret_t").html('<select id="ret" name="ret" class="required"></select>');$("#ret").fcbkcomplete({ json_url: page,cache: false,filter_case: false,filter_hide: false,firstselected: false});});
$('#ret_sta').click(function(){page="state.php";$("#ret_t").html('<select id="ret" name="ret" class="required"></select>');$("#ret").fcbkcomplete({ json_url: page,cache: false,filter_case: false,filter_hide: false,firstselected: false});});
$('#ret_con').click(function(){page="country.php";$("#ret_t").html('<select id="ret" name="ret" class="required"></select>');$("#ret").fcbkcomplete({ json_url: page,cache: false,filter_case: false,filter_hide: false,firstselected: false});});
$('#ret_reg').click(function(){page="region.php";$("#ret_t").html('<select id="ret" name="ret" class="required"></select>');$("#ret").fcbkcomplete({ json_url: page,cache: false,filter_case: false,filter_hide: false,firstselected: false});});

$('#ret_all').click(function(){
							$("#ret_t").html('<input type="text" name="ret[]" id="ret" value="ALL" readonly="readonly" width="300" height="15" />');							
							});


$("#create_config").validate({
							 
		
   submitHandler: function(form) {
	   
	  	
	   
		$.ajax({
				type:"POST",
				url:"make_config.php",
				data:$("#create_config").serialize(),
				cache: false,
				
				success: function(msg){
     				$("#contactArea").html("<div style='padding-top:120px; text-align:center;  color:green;'><img src='accept.png' align='absmiddle'> Your New Configuration is sucessfully Created....</div>");
					jQuery("#flex1").flexReload(); 
					disablePopup();
					
   						}

		});
		 $("#contactArea").html("<div style='padding-top:120px; text-align:center;'><img src='18-0.gif' align='absmiddle'><br>Creating New Configuration ....</div>");

   }
})






$("#update_config").validate({
							 
		
   submitHandler: function(form) {
	   
	  	
	   
		$.ajax({
				type:"POST",
				url:"update_config.php",
				data:$("#update_config").serialize(),
				cache: false,
				
				success: function(msg){
     				$("#contactArea").html("<div style='padding-top:120px; text-align:center;  color:green;'><img src='accept.png' align='absmiddle'> Your Configuration is sucessfully Upadated....</div>");
					jQuery("#flex1").flexReload(); 
					disablePopup();
   						}

		});
		 $("#contactArea").html("<div style='padding-top:120px; text-align:center;'><img src='18-0.gif' align='absmiddle'><br>Submitting Configuration Form....</div>");

   }
})
